<?php

ignore_user_abort(true); // 后台运行，不受前端断开连接影响
set_time_limit(0);
ini_set('max_execution_time', '0');
chdir(dirname(__FILE__));
error_reporting(E_ERROR);
require_once ("../log.php");
require_once ("../config.php");//引入配置ss
require_once ("../api/api_tool.php");

$wx_group = AllQuery("SELECT rot.id AS id, rot.wechat_id AS wechat_id, ser.host AS host, ser.port AS port FROM robot AS rot, server AS ser WHERE rot.server_id = ser.id AND wechat_id <> '' AND wechat_id <> '0';");
for ($wx_num = 0; $wx_num < count($wx_group); ++$wx_num) {
    $wx_data = $wx_group[$wx_num];
    if (empty($wx_data['wechat_id'])) {
        continue;
    }
    $host = $wx_data['host'];
    $port = $wx_data['port'];
    $url  = "/api/api_accept_post.php";
    $data = array();
    $data['id']     = $wx_data['id'];
    $data['wx_id']  = $wx_data['wechat_id'];
    $data['fun']    = "get_heart_beat";
    $data['sign']   = generateSign($data);

    sendFZSHttp($host, $port, $url, $data);
}

exit();

?>